package com.sdyeda.readiot.iotinfo;

import java.util.List;

public class DtuInfo {

	private String ip;
	private int port;

	public DtuInfo(String ip,int port) {
		setIp(ip);
		setPort(port);
	}
	
	public static boolean find(DtuInfo dtuinfo,List<DtuInfo>dtus) {
		boolean result =false;
		if(dtus != null) {
			for(int i=0;i<dtus.size();i++){
				if(dtus.get(i).getIp().equals(dtuinfo.getIp()) && dtus.get(i).getPort() == dtuinfo.getPort()) {
					result = true;
					break;
				}
			}
		}
		return result;
	}

	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public int getPort() {
		return port;
	}
	public void setPort(int port) {
		this.port = port;
	}

}
